1. Technical Field
The invention relates to processor scheduling for a computer and more particularly to regulation of time slice durations allocated processes for execution. Still more particularly, the invention relates to the dynamic regulation of time slice duration as a function of selected operating environment conditions relating to the possible occurrence of memory churning.
2. Description of the Related Art
Microcomputer systems based upon either the Intel 80386 microprocessor or the 80486 microprocessor available from Intel Corp. and utilizing an OS/2.RTM. version 2.x operating system available from International Business Machines Corporation have considerable capacity for executing multiple concurrent processes. For example, such a microcomputer system can support emulation of a plurality of concurrent virtual DOS machines ("VDMs"), which in turn execute MS-DOS.RTM. (a registered trademark of Microsoft Corporation) version specific application programs.
To the user, one desktop personal computer appears to simultaneously function as two or more Intel 8086 microprocessor based machines utilizing distinct versions of MS-DOS, such as versions 2.0 or 3.2. This allows the user to run version specific application programs, such as games, word processing programs, or other applications. Each virtual machine is an example of a process, or collection of processes, which may be displayed to the user on the system display device in its own window or represented as a icon.
In the computer, a single microprocessor, functioning as the computer's central processing unit periodically executes the process corresponding to each of the current processes. The concurrent existence of several VDMs means the concurrent existence of numerous processes. Because only one process at a time is executed on the processor, central processing unit time must be allocated. Operating systems have long dealt with multitasking of computer processors and are known as time distribution operating systems. The operating system includes still another process, called the scheduler, which is periodically run to schedule tasks for the processor.
Processes are ranked in priority for the scheduler. For example, processes relating to update of the display image on a video display device may be run on a real time basis, to give the user the impression of near instantaneous responsiveness of the computer. Housekeeping tasks may be relegated to the lowest priority levels. Intermediate priority levels exist for remaining applications, based upon various factors. Processes of equal execution priority are granted central processing unit time on a rotating basis, with each process getting a predefined quanta of time known as a time slice.
A current process is one allocated some physical location in computer memory. The term "computer memory" is used here in reference to program addressable storage from which instructions and other data can be loaded directly into registers of the central processing unit for subsequent execution or other utilization. Typically, where a plurality of processes are concurrent, insufficient space will exist in computer memory to satisfy the demands of all of the processes. Computer memory will not have a sufficient number of storage locations to provide such locations on an exclusive basis for each address space location for all of the processes.
A way of evading the physical constraints on computer memory size has been provided by virtual storage. Virtual storage may be regarded as addressable main storage by the user of a computer in which virtual addresses are mapped into real addresses of the computer memory. The size of virtual storage is limited only by the addressing scheme of the computer and its operating system and by the amount of auxiliary memory available, such a disk drives or tapes. Thus virtual storage is not limited by the actual number of physical locations in computer memory. The practical implication of this arrangement is that some of the instructions and the data for a process will not physically be in computer memory, even though they may be addressed as though they were. Rather, some of the instructions and other data reside on a disk drive or other auxiliary memory device. Upon being addressed, supporting software of the operating system will intervene in a way substantially transparent to the user to move the addressed information to computer memory from which it can be more quickly moved to and from the registers of the central processing unit.
Virtual storage is applied to computer systems having small computer memory, and it is utilized in computer systems executing numerous concurrent processes. For example, each current VDM on a computer has its own virtual storage address space or domain.
Virtual storage however does not come without costs in terms of operating speed, particularly when computer memory is severely oversubscribed. When the central processing unit shifts from one process to another, a phenomena called a context switch occurs. At the end of a time slice an interrupt is applied to the central processing unit from a timer. All of the registers of the old process are saved and registers for the new process are loaded. Where the cumulative space of virtual storage is large this may entail a number of transfers of data between computer memory and auxiliary memory. As the number of current processes increase, and, consequently, the space available in computer memory for each process decreases, the number of transfers of memory pages to and from auxiliary memory (paging) increases. When the computer spends more time paging then performing useful work, memory thrashing is occurring. In the prior art this situation was avoided by blocking addition of new processes to a system when memory commitment reached certain levels.
As a general rule, computer memory is relatively fast, small and expensive while auxiliary memory is cheap, slow and of large capacity. Accesses to auxiliary memory are extremely time consuming relative to central processing unit operating speeds. As the computer is loaded with more current processes, more and more time is devoted to handling problems such as context switches, memory management and process scheduling and less time is devoted to productive work. A predetermined time slice, designed to assure reasonable responsive to each task loaded onto the computer, leads instead to unresponsiveness to all of the tasks.